import 'package:flutter/material.dart';

import 'package:shop/util/http.dart';
import 'package:shop/models/detail_data.dart';

class DetailViewModel extends ChangeNotifier {
  var dtailInfo = DetailInfo();

  void getDetailData(String goodsId) async {
    final data =
        await Http.request('/goods/detail', param: {'goods_id': goodsId});

    dtailInfo = DetailData.fromJson(data).message ?? DetailInfo();

    notifyListeners();
  }
}
